package com.example.jsoup.controller;

import com.example.jsoup.service.CsdnService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@AllArgsConstructor
@RequestMapping("/csdn")
@RestController
@Slf4j
public class CsdnController {

    private final CsdnService csdnService;

    @GetMapping("addtask")
    public String a() throws IOException {
        csdnService.createTask();
        return "成功";
    }

    @GetMapping("testlog")
    public String b() {
        log.info("INFO");
        log.warn("WARN");
        log.error("ERROR");
        log.debug("DEBUG");
        return "成功";
    }
}
